﻿<!DOCTYPE html>
<!--作业许可证管理=>作业许可证申请=>受影响相关方添加页 -->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>


</head>
<body>


    
<div id="app" v-cloak>   

        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini">

            <div style="width:100%;text-align:center ">
                <label style="font-weight:bold">受影响相关方</label>
            </div>
            <el-row>

                <el-col :sqpn="24">
                    <el-form-item :label="'单位:'">
                        <el-select @visible-change="visibleChange" v-model="Form.unit">
                            <el-option v-for="item in unitDepartment" :label="item.value" :value="item.key"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>

            <el-row>
                <el-col :sqpn="24">
                    <el-form-item :label="'确认人:'">
                        <el-select @visible-change="visibleChange" v-model="Form.unitPeople">
                            <el-option v-for="item in PeopleList" :label="item.value" :value="item.key"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row type="flex" justify="center">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm">{{col.btnConfirm}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: {
                //父业传参 
                id: '',
                //业务表单内容
                Form: {
                    unit: '',
                    unitPeople: '',
                },
                unitDepartment: [],
                PeopleList: [],
                //表单验证
                rules: {
                    unit: [
                        verification.NotNull                   
                    ],
                    unitPeople: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function () {
                    var unitname = getDicValue('08' ,this.Form.unit)
                    var unitPeoplename = getDicValue('09', this.Form.unitPeople)
                    parent.app.Form.AffectedParties.push({
                        unit: unitname,
                        unitPeople: unitPeoplename
                    });
                    parent.app.ListItem.dialogVisible = false;
                }
            },
            mounted: function () {
                this.unitDepartment = getDicData('08');
                this.PeopleList = getDicData('09');
           
            },
        });
    </script>
</body>
</html>